//
//  XWSessionManager.swift
//  iOS-XiaWan
//
//  Created by Miles on 2023/10/10.
//  Copyright © 2023 turningsyn. All rights reserved.
//


import Alamofire
import Foundation

class XWSessionManager: SessionManager {
    static var theManager : XWSessionManager?
    class func shareManager(timeOutFlo:TimeInterval = 15) -> XWSessionManager {
        let config = XWConfig.shareConfig()
        config.timeoutIntervalForRequest = timeOutFlo
        if theManager == nil{
            theManager = XWSessionManager.init(configuration: config)
        }
        return theManager!
    }
}

class XWConfig: URLSessionConfiguration {
    static var theConfig:URLSessionConfiguration?
    class func shareConfig() -> URLSessionConfiguration {
        if theConfig == nil {
            theConfig = URLSessionConfiguration.default
        }
        return theConfig!
    }
}
